const fs = require('fs');

// const path = require('path');

// 往目标文件中写入wiki文件
module.exports = function(option,callback){

  let {filePath,version,md5sum,user,branch,memo,oneLine} = option;

  let content = `|- align=center
|| ${version} || ${new Date().Format('yyyy-MM-dd HH:mm:ss')} || ${md5sum} || ${user} || ${branch} || ${memo}||
==${version}==
*修改记录(给人看的)
*gitlog(非人看的)
${oneLine}`;

  fs.writeFileSync(filePath+'.wiki',content);

  option.filePath = filePath+'.wiki';
  
  if(callback instanceof Function)callback(option);
}